//1. 导入vue-router相关函数
import { createRouter, createWebHashHistory } from "vue-router"
// 导入页面组件
import Home from "../views/home/Home.vue" 
import Login from "../views/login/Login.vue"
import ProjectList from '../views/projectManage/projectList.vue'
import ProjectAdd from '../views/projectManage/projectAdd.vue'
import ProjectEdit from '../views/projectManage/projectEdit.vue'
import ProjectWholeInfo from '../views/projectView/projectWholeInfo.vue'
import ProjectCodeInfo from '../views/projectView/projectCodeInfo.vue'
import ProjectFunctionCall from '../views/projectView/projectFunctionCall.vue'

// 2.路由规则/路由路径
const routes = [
    {
        path: "/",
        component: Login
    },
    {
        path: "/login",
        name: "login",
        component: Login
    },
    {
        path: "/home",
        name: "home",
        component: Home,
        children: [
            { path: 'projectList', name:"projectList",component: ProjectList },
            { path: 'projectAdd', name:"projectAdd",component: ProjectAdd },
            { path: 'projectEdit', name:"projectEdit",component: ProjectEdit },
            { path: 'projectWholeInfo', name:"projectWholeInfo",component: ProjectWholeInfo },
            { path: 'projectCodeInfo', name:"projectCodeInfo",component: ProjectCodeInfo },
            { path: 'projectFunctionCall', name:"projectFunctionCall",component: ProjectFunctionCall },
            
          ]
    },
   
    
]
// 3.路由对象实例化/创建路由
const router = createRouter({
    history: createWebHashHistory(),
    routes
})
// 暴露导出
export default router